<?php
/**
 * 权限管理a
 * Created by gii.
 * User: Gii
 * Date: 2022/04/19
 * Time: 19:15
 */

namespace app\admin\logic\system;

use app\admin\model\model\system\SystemAccountAuth;

class AccountAuthLogic
{
    public static function getListWithCount($where=[], $field='*', $page=1, $limit=10, $order='id desc') {
        $where = SystemAccountAuth::getSelfWhereCommon($where);
        return SystemAccountAuth::getListWithCountCommon($where, $field, $page, $limit, $order);
    }

    public static function getAll() {
        return SystemAccountAuth::getAllCommon();
    }

    public static function del($id) {
        return SystemAccountAuth::delByPkCommon($id);
    }

    public static function update($data,$where=[]) {
        return SystemAccountAuth::updateCommon($data,$where);
    }

    public static function add($data) {
        return SystemAccountAuth::addCommon($data);
    }

    public static function getOne($id) {
        return SystemAccountAuth::getLineByPkCommon($id);
    }
    
    public static function getOneByAccount($accountId){
        return SystemAccountAuth::getOneByAccount($accountId);
    }

    public static function status($id, $status) {
        return SystemAccountAuth::status($id, $status);
    }
}
